import {Component, ComponentProps, VueComponent} from "vue3-oop";
import {NScrollbar,NForm} from "naive-ui";
import FormData from '../types/FormData'
import FlexView from '../widgets/layouts/flex/FlexView'
import styles from "./index.module.scss";

interface IProps {
  formData: FormData,
  maxHeight?:number
}
@Component()
export default class ViewPanel extends VueComponent<IProps> {
  static defaultProps: ComponentProps<IProps> = {
    formData: {},
    maxHeight: {default: 600}
  }

  render(){

    return(
      <NForm
        class={[styles.view_panel]}
      >
        <FlexView
          formData={this.props.formData}
          widgetNode={this.props.formData.nodeTree}
          style={{minHeight:`${this.props.maxHeight}px`,backgroundColor:"white"}}
        />
      </NForm>
    )
  }
}